<?php
$ddlActivity = $_POST['form'];
include 'conn.php';

$result = mysql_query("SELECT ar.NRIC, ar.CentreId, ar.Date, a.ActivityName
FROM activityrecord ar, activity a
WHERE ar.ActivityId = a.ActivityId and DATE(Date)=CURDATE() and a.ActivityId=$ddlActivity");

echo "<table class='tablereport' id='tblAttendance' border='5'  valign='top'><tr >
<td name='NRIC'>
<font face='Arial, Helvetica, sans-serif'>NRIC</font>
</td>
<td name='CentreId'>
<font face='Arial, Helvetica, sans-serif'>CentreId</font>
</td>
<td name='Date' >
<font face='Arial, Helvetica, sans-serif'>Date</font>
</td>
<td name='ActivityName' >
<font face='Arial, Helvetica, sans-serif'>Activity Name</font>

</td>
</tr>";
$count=0;
while($row = mysql_fetch_array($result))
  {
  echo"<tr>
<td >
<font face='Arial, Helvetica, sans-serif'>".$row['NRIC']."</font>
</td >
<td >
<font face='Arial, Helvetica, sans-serif'>".$row['CentreId']."</font>
</td>
<td >
<font face='Arial, Helvetica, sans-serif'>".$row['Date']."</font>
</td>
<td>
<font face='Arial, Helvetica, sans-serif'>".$row['ActivityName']."</font>
</td>
</tr>";
$count++;
}

echo "</table>";

			 ?>